package cn.edu.ujn.project.supermarket.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.ujn.project.common.core.text.Convert;
import cn.edu.ujn.project.supermarket.domain.SellReport;
import cn.edu.ujn.project.supermarket.extendbean.SellReportChild;
import cn.edu.ujn.project.supermarket.mapper.SellReportMapper;
import cn.edu.ujn.project.supermarket.service.ISellReportService;

/**
 * 销售记录Service业务层处理
 * 
 * @author zhaomh
 * @date 2023-11-13
 */
@Service
public class SellReportServiceImpl implements ISellReportService 
{
    @Autowired
    private SellReportMapper sellReportMapper;

    /**
     * 查询销售记录
     * 
     * @param sellId 销售记录主键
     * @return 销售记录
     */
    @Override
    public SellReport selectSellReportBySellId(String sellId)
    {
        return sellReportMapper.selectSellReportBySellId(sellId);
    }
    @Override
    public List<SellReportChild>  selectSellReportChildList(SellReportChild sellReportChild)
    {
        return sellReportMapper.selectSellReportChildList(sellReportChild);
    }
    /**
     * 查询销售记录列表
     * 
     * @param sellReport 销售记录
     * @return 销售记录
     */
    @Override
    public List<SellReport> selectSellReportList(SellReport sellReport)
    {
        return sellReportMapper.selectSellReportList(sellReport);
    }

    /**
     * 新增销售记录
     * 
     * @param sellReport 销售记录
     * @return 结果
     */
    @Override
    public int insertSellReport(SellReport sellReport)
    {
        return sellReportMapper.insertSellReport(sellReport);
    }

    /**
     * 修改销售记录
     * 
     * @param sellReport 销售记录
     * @return 结果
     */
    @Override
    public int updateSellReport(SellReport sellReport)
    {
        return sellReportMapper.updateSellReport(sellReport);
    }

    /**
     * 批量删除销售记录
     * 
     * @param sellIds 需要删除的销售记录主键
     * @return 结果
     */
    @Override
    public int deleteSellReportBySellIds(String sellIds)
    {
        return sellReportMapper.deleteSellReportBySellIds(Convert.toStrArray(sellIds));
    }

    /**
     * 删除销售记录信息
     * 
     * @param sellId 销售记录主键
     * @return 结果
     */
    @Override
    public int deleteSellReportBySellId(String sellId)
    {
        return sellReportMapper.deleteSellReportBySellId(sellId);
    }
}
